const TokenKey = 'VAR_token'

export function getToken() {
  return localStorage.getItem(TokenKey)
}

export function setToken(token: string) {
  return localStorage.setItem(TokenKey, token)
}

export function removeToken() {
  return localStorage.removeItem(TokenKey)
}

// 存储
export const setData = (key: string, data: any) => {
  sessionStorage.setItem(key, JSON.stringify(data))
}
// 获取
export const getData = (data: string) => {
  return JSON.parse(sessionStorage.getItem(data) as string) || []
}
// 移除
export const remData = (key: string) => {
  sessionStorage.removeItem(key)
}
